package org.example.Controller;

import org.example.Forms.IForm;
import org.example.Forms.testForm;
import org.example.dataHandle.TaskRecord;

import java.util.function.Function;

public class TaskFormNode extends FormManagerNode{
    private final int bindTaskId;

    public int getBindTaskId() {
        return bindTaskId;
    }

    public TaskFormNode(Function<FormManagerNode, IForm> factory, FormManagerNode parent, RunTask task) {
        super(factory, parent);
        bindTaskId = task.getId();
    }

    public void setFormRecord(TaskRecord<? extends Number> record){
        builder.addProperty(record,(r,iform)->((testForm)iform).setRecord((TaskRecord<? extends Number>)r));
    }
}
